package com.lzpu.thymeleafproject.demos.entity;

import lombok.Data;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;

import javax.persistence.Id;
import java.util.List;

@Data
@RedisHash("persons")
public class Person {
    @Id       //用于表示实体类主键
    private String id;
    @Indexed  //标记该属性会在Redis数据库中生成二级索引
    private String firstname;
    @Indexed
    private String lastname;
    private Address address;
    private List<Family> familyList;
}
